package com.jackson.Service.impl;

import com.jackson.Dao.UserDao;
import com.jackson.Dao.impl.UserDaoImpl;
import com.jackson.Service.UserService;
import com.jackson.utils.BeanFactory;

/*
 * Author: JacksonCoder
 * FileName: UserServiceImpl
 * Version: 1.0.0
 */
public class UserServiceImpl implements UserService {

    public void save() {
        // 调用Dao层方法，传统方式：存在编译期依赖，   耦合重
//        UserDao userDao = new UserDaoImpl();
//        userDao.save();

        // 反射
        UserDao userDao = (UserDao) BeanFactory.getBean("userDao");
        userDao.save();
        System.out.println("调用了Service...");
    }
}
